package pe.gob.mimp.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import pe.gob.mimp.dao.CasoSocialDao;
import pe.gob.mimp.model.CasoSocial;
import pe.gob.mimp.model.CasoSocialBusqueda;
import pe.gob.mimp.service.CasoSocialService;

@Service("casoSocialService")
@Transactional(readOnly = true)
public class CasoSocialServiceImpl implements CasoSocialService {
	@Autowired
	private CasoSocialDao casoSocialDao;

	@Transactional(propagation = Propagation.REQUIRED, readOnly = false)
	public CasoSocial getCasoSocialPorId(Long idCasosocial) {
		return casoSocialDao.getCasoSocialPorId(idCasosocial);
	}

	@Transactional(propagation = Propagation.REQUIRED, readOnly = false)
	public void saveCasoSocial(CasoSocial casoSocial) {
		casoSocialDao.saveCasoSocial(casoSocial);
	}

	@Transactional(propagation = Propagation.REQUIRED, readOnly = false)
	public List<CasoSocialBusqueda> buscaCasoSocial(
			CasoSocialBusqueda casoSocialBusqueda) {
		return casoSocialDao.buscaCasoSocial(casoSocialBusqueda);
	}
	
	@Transactional(propagation = Propagation.REQUIRED, readOnly = false)
	public CasoSocialBusqueda getCasoSocialResumen(Long idCasosocial){
		return casoSocialDao.getCasoSocialResumen(idCasosocial);
	}

}
